package edu.hhu.wifispark.entry;

import com.jfinal.plugin.activerecord.Model;

public class Customerlive extends Model<Customerlive>{

	private static final long serialVersionUID = 1L;
	public final static Customerlive dao = new Customerlive();
	
	public int selectOldCustomer(long stime){
		long etime = stime+3600000;
		String sql = "SELECT COUNT(*) as counts from customerlive WHERE mac in (SELECT mac FROM basephone WHERE atime > "+stime+" AND atime < "+etime+" AND `inner`=1)";
		Customerlive customerlive = findFirst(sql);
		int oldCount = customerlive.getLong("counts").intValue();
		return oldCount;
	}
}
